package com.tyun.modules.sys.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.tyun.common.utils.R;
import com.tyun.modules.sys.entity.SysLog;
import com.tyun.modules.sys.service.ISysLogService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统日志
 *
 * @author congcong tao
 * @date 2018/5/16 16:59
 */
@RestController
@RequestMapping("sysLog")
public class SysLogController extends CommonController{

    private static final Logger logger = LogManager.getLogger(SysLogController.class);

    @Autowired
    private ISysLogService sysLogService;

    @GetMapping("/page")
    public R page(Page<SysLog> page, SysLog sysLog){
        sysLogService.selectPage(page, new EntityWrapper<>(sysLog));
        return R.ok().put("rows", page.getRecords()).put("total", page.getTotal());
    }
}
